const inventorts = [
    { first: 'Alert', last: 'Einstein', year: 1897 },
    { first: 'Isacc', last: 'Newton', year: 1643 },
    { first: 'Galileo', last: 'Galilei', year: 1564 },
    { first: 'Marie', last: 'Gurie', year: 1867 },
    { first: 'Johannes', last: 'Kapler', year: 1571 },
    { first: 'Nicolaus', last: 'Copernicus', year: 1473 },
    { first: 'Max', last: 'Planck', year: 1858 },
]
function* getDate(arr) { //Generator
    // console.log(inventorts);
    for (let item of arr) {
        yield item
    }
}
const inventortsGen = getDate(inventorts)
var k = 0;
while (k <= inventorts.length) {
    console.log(inventortsGen.next());
    k++
}
